import React from "react";
import {ActivityIndicator, Text, StyleSheet, View} from 'react-native'
import PropTypes from 'prop-types';
import {color} from '../utils'


export const Loading = ({context = '请稍等...'}) => {
    return <View style={sty.container}>
        <ActivityIndicator size={'small'} color={color.loadingColor}/>
        <Text style={sty.context}>{context}</Text>
    </View>
}
Loading.prototype = {
    context: PropTypes.string
}
const sty = StyleSheet.create({
    container: {
        position: 'absolute',
        right: 0, left: 0, top: 0, bottom: 0,
        width: 100,
        height: 100,
        justifyContent: 'space-around',
        alignItems: 'center',
        backgroundColor: 'rgba(0,0,0,.5)',
        borderRadius: 10
    },
    context: {
        color: '#fff',
    }
})
